package com.mjh.zhujianju.enums;

public enum SupervisionTypeEnum {

	internal("1","内部工作"),
	visit("2","信访工作");

    private String code;
    private String name;

    SupervisionTypeEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static SupervisionTypeEnum[] getEnums(){
        return SupervisionTypeEnum.values();
    }

    public static String getName(String code){
        if(code == null){
            return null;
        }

        for (SupervisionTypeEnum SupervisionEnum : SupervisionTypeEnum.values()){
            if(code.equals(SupervisionEnum.getCode())){
                return SupervisionEnum.getName();
            }
        }

        return null;
    }
}
